package com.etlmaster.datax.plugins.reader.directoryReader;

import java.util.ArrayList;
import java.util.List;

import com.dp.nebula.wormhole.common.AbstractSplitter;
import com.dp.nebula.wormhole.common.interfaces.IParam;
import com.etlmaster.datax.common.utils.FileScanInfo;

public class DirectoryReaderSplitter  extends AbstractSplitter{
	public List<IParam> split() {
		List<IParam> paramList = new ArrayList<IParam>();
		List<FileScanInfo> fileList=DirectoryReaderPeriphery.foundFiles;
		for(FileScanInfo file:fileList){
			IParam iparam=param.clone();
			iparam.putValue(ParamKey.directoryPath, file.getVfsURI());
			iparam.putValue(ParamKey.colDelimiter, param.getValue(ParamKey.colDelimiter));
			paramList.add(iparam);
		}
		return paramList;
	}

}
